package com.wushi.lenovo.asia5b.app_model.credit.bean;

import android.text.TextUtils;

import com.mvp.base.model.BaseModel;
import com.mvp.utils.DecimalUtil;
import com.wushi.lenovo.asia5b.app_model.credit.MemberBlanceModel;

public class TopupInfoBean extends BaseModel {
    public static final int OrderPaymentType_fist = 1;
    public static final int OrderPaymentType_second = 2;
    public static final int OrderPaymentType_diff = 3;
    //付款类型,如果OrderPaymentType==0,表示付款类型为充值
    public int OrderPaymentType = 0;
    //商品类型 0:无 1:代购 2:自营
    public int goodsType=0;
    private String totalAmount;//账单总额(支付金额,284.03)
    private int checkout_log_id;//使用订单充值时产生的id
    private MemberBlanceModel memberBlanceModel;//账户余额信息

    public int getCheckout_log_id() {
        return checkout_log_id;
    }

    public void setCheckout_log_id(int checkout_log_id) {
        this.checkout_log_id = checkout_log_id;
    }

    public String getBalance_value() {
        return memberBlanceModel.getBalance_value();
    }

    public String getTotalAmount() {
        if (TextUtils.isEmpty(totalAmount)) {
            return "";
        }
        return totalAmount;
    }

    public void setTotalAmount(String totalAmount) {
        this.totalAmount = totalAmount;
    }

    /**
     * 补差价=总价-账户余额
     *
     * @return
     */
    public String getDiffAmount() {
        String diffPrice = DecimalUtil.subtract(totalAmount, getBalance_value());
        return diffPrice;
    }

    public float getDiffAmountF() {
        return parseFloat(getDiffAmount());
    }

    public void setMemberBlanceModel(MemberBlanceModel memberBlanceModel) {
        this.memberBlanceModel = memberBlanceModel;
    }
}
